package cn.iocoder.yudao.module.biz.dal.mysql.htPlan;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.controller.admin.htPlanDetail.vo.HtPlanDetailJoinPageVO;
import cn.iocoder.yudao.module.biz.controller.admin.htPlanDetail.vo.HtPlanDetailPageReqVO;
import cn.iocoder.yudao.module.biz.dal.dataobject.htPlan.HtPlanDO;
import cn.iocoder.yudao.module.biz.job.planExe.HtPlanExeJoinVO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.htPlan.vo.*;

/**
 * 隐患排查计划 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface HtPlanMapper extends BaseMapperX<HtPlanDO> {

    default PageResult<HtPlanDO> selectPage(HtPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HtPlanDO>()
                .likeIfPresent(HtPlanDO::getPlanName, reqVO.getPlanName())
                .eqIfPresent(HtPlanDO::getPlanState, reqVO.getPlanState())
                .orderByDesc(HtPlanDO::getId));
    }

    default List<HtPlanDO> selectList(HtPlanExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<HtPlanDO>()
                .likeIfPresent(HtPlanDO::getPlanName, reqVO.getPlanName())
                .eqIfPresent(HtPlanDO::getPlanState, reqVO.getPlanState())
                .orderByDesc(HtPlanDO::getId));
    }

    List<HtPlanRiskVO> queryByPlan(String planId);

    List<HtPlanJoinPageVO> selectHtPlanPage(HtPlanPageReqVO pageVO);

    Integer selectHtPlanPageCount(HtPlanPageReqVO pageVO);

    List<HtPlanExeJoinVO> listPlanExe(Map<String, Object> map);
}